/*
 * @Description: 
 * @Version: 2.0
 * @Date: 2024-04-09 13:06:16
 * @LastEditTime: 2024-04-09 13:17:42
 */
// localStorage.ts
/**
 * window.localStorage 浏览器永久缓存
 */
export const local = {
    // 设置永久缓存
    set(key: string, val: any) {
      window.localStorage.setItem(key, JSON.stringify(val));
    },
    // 获取永久缓存
    get(key: string) {
      const json: any = window.localStorage.getItem(key);
      return JSON.parse(json);
    },
    // 移除永久缓存
    remove(key: string) {
      window.localStorage.removeItem(key);
    },
    // 移除全部永久缓存
    clear() {
      window.localStorage.clear();
    }
  };
  